package com.parsechina.hpush.broker.config;

import java.nio.charset.Charset;

/**
 * @author linfeng
 * @since 2016/11/22
 */
public class MqttConstants {

    public static final byte VERSION_3_1 = 3;
    public static final byte VERSION_3_1_1 = 4;

    public static final String ATTR_CLIENTID = "ClientID";
    public static final String CLEAN_SESSION = "cleanSession";
    public static final String KEEP_ALIVE = "keepAlive";
    //number of messages
    public static final int MAX_MESSAGE_QUEUE = 1024;

    public static final Charset UTF8 = Charset.forName("UTF-8");

    public static final String CACHE_CLIENT_INFO_KEY = "clientInfoPersisted";
    public static final String CACHE_RETAINED_INDEX_KEY = "retained_index";
    public static final String CACHE_PERSISTED_MESSAGES_KEY = "persistedMessages";
    public static final String CACHE_RETAINED_KEY = "retained_key";


    public static final String LOCAL_CACHE_INFLIGHT_KEY = "inflight";
    public static final String LOCAL_CACHE_INFLIGHT_PACKET_IDS_KEY = "inflight_packet_ids";
    public static final String LOCAL_CACHE_SESSIONS_KEY = "sessions";
    public static final String LOCAL_CACHE_SESSION_QUEUE_KEY = "session_queue";
    public static final String LOCAL_CACHE_SECOND_PHASE_KEY = "second_phase";
    public static final String CACHE_SESSION_PERSISTED_MESSAGES_KEY = "sessionPersistedMessages";
    public static final String DEFAULT_HPUSH_STORE_MAP_DB_FILENAME = "hpush_store.mapdb";


}
